package main.java;
import java.util.Arrays;

public class Anniversary {
    /**
     * 选取的个数通过resultList的长度体现
     * @param dataList 输入
     * @param dataIndex 工作下标
     * @param resultList 结果集
     * @param resultIndex 结果完成了的下标
     */
    private static void combinationSelect(int[] dataList, int dataIndex, int[] resultList, int resultIndex) {
        if(resultList.length == resultIndex){
            System.out.println(Arrays.toString(resultList));
            return;
        }
        for(int i =dataIndex;i<dataList.length; i++){
            resultList[resultIndex]=dataList[i];
            combinationSelect(dataList,i+1,resultList,resultIndex+1);
        }
    }
    /**
     * @param input
     * @param number input的工作下标（已完成的个数）
     * @param result
     * @param resultIndex
     */


    public void recuision(char[] input,int number,char[] result,int resultIndex){
        if(number==0)
            System.out.println(Arrays.toString(result));
        for (int i = 0; i < input.length ; i++) {
            if(!find(result,input[i],resultIndex)){
                result[resultIndex]=input[i];
                recuision(input,number-1,result,resultIndex+1);
            }
        }
    }
    public boolean find(char[] input,char f,int length){
        for (int i = 0; i < length; i++) {
            if (input[i]==f)
                return true;
        }
        return false;
    }
}
